#!/bin/bash

# Development environment startup script

echo "🚀 Starting AI Writing Platform in development mode..."

# Start Docker services
echo "🐳 Starting Docker services..."
docker-compose up -d

# Wait for services to be ready
echo "⏳ Waiting for services to be ready..."
sleep 5

# Check service health
echo "🏥 Checking service health..."
curl -s http://localhost:8000/health | python3 -m json.tool

echo "✅ All services started!"
echo ""
echo "📍 Services available at:"
echo "   Frontend: http://localhost:3000"
echo "   API: http://localhost:8000"
echo "   API Docs: http://localhost:8000/docs"
echo ""
echo "📊 Databases:"
echo "   PostgreSQL: localhost:5432"
echo "   MongoDB: localhost:27017"
echo "   Redis: localhost:6379"
echo ""
echo "Press Ctrl+C to stop all services"

# Keep script running and show logs
docker-compose logs -f